package com.dai.spec.gxk.vo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.dai.spec.common.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class SelectedCourseVO implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    @NotNull
    private Long id;

    /**
     * 学生学号
     */
    @NotNull(message = "必须选择学生")
    private Long studentNumber;

    /**
     * 课程名称
     */
    @Excel(name = "课程名称")
    @NotNull(message = "课程名称不能为空")
    private String courseName;

    /**
     * 课程描述
     */
    @NotNull(message = "课程描述不能为空")
    private String description;

    /**
     * 课程学分
     */
    @Excel(name = "课程学分")
    @NotNull
    @Range(min = 1, max = 3, message = "学分必须在1-3之间")
    private BigDecimal credits;

    /**
     * 开课院系
     */
    @Excel(name = "开课院系")
    @NotNull(message = "开课院系不能为空")
    private String department;

    /**
     * 课程周期
     */
    @Excel(name = "课程周期")
    @NotNull(message = "课程周期不能为空")
    private String courseCycle;

    /**
     * 开课时间
     */
    private Date startTime;

    /**
     * 上课地点
     */
    @Excel(name = "上课地点")
    private String location;

    /**
     * 课程容量
     */
    @NotNull
    @Range(min = 0,message = "课程容量必须>=0")
    private Long plantCounts;

    /**
     * 剩余课程数量
     */
    private Long leaveCounts;

    /**
     * 课程类型
     */
    @Excel(name = "课程类型")
    @NotNull
    private String type;

    /**
     * 状态
     */
    @Excel(name = "状态 ")
    @NotNull
    private String status;

    /**
     * 成绩
     */
    @NotNull
    @Range(min = 0,max = 100,message = "课程成绩必须在0~100之间")
    private Long score;

    /**
     * 任课老师id
     */
    @Excel(name="任课老师")
    @NotNull(message = "必须选择任课老师")
    private String teacherName;

    /**
     *  开课类型
     */
    @Excel(name = "开课类型")
    private String deliveryType;

    /**
     * 选课状态
     */
    @Excel(name = "选课状态")
    @NotNull(message = "课程状态不能为空")
    private String selectStatus;

    /**
     * 选课时间
     */
    @Excel(name = "选课时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private LocalDateTime selectTime;

    /**
     * 退课时间
     */
    @Excel(name = "退课时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private LocalDateTime dropTime;
}
